﻿using S.RBAC.Domain.Help;
using S.RBAC.Domain.Model;
using S.RBAC.Infrastructure.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace S.RBAC.Infrastructure.Impl
{
    public class DepartmentRepository : BaseRepository<Department>, IDepartmentRepository
    {
        public DepartmentRepository(EFCoreContext context) : base(context)
        {
        }

        public async Task<int> AddDepartment(Department department)
        {
            return await AddAsync(department);
        }

        public async Task<List<Department>> GetAllDepartment()
        {
            return await GetAllAsync();
        }

        public Task<List<MenuItem>> GetDepartment(int departId)
        {
            throw new NotImplementedException();
        }

        public async Task<Department> GetInfoDepartment(Expression<Func<Department, bool>> expre)
        {
            return await GetInfoAsync(expre);
        }

        public async Task<List<Department>> GetListDepartment(Expression<Func<Department, bool>> expre)
        {
            return await GetListAsync(expre);
        }
    }
}
